Optimal. Leaf size=12 \[ -a \csc (x)-b \tanh ^{-1}(\cos (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.03, antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3089, 3770, 2606, 8} \[ -a \csc (x)-b \tanh ^{-1}(\cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2606
Rule 3089
Rule 3770
Rubi steps
\begin {align*} \int \csc ^2(x) (a \cos (x)+b \sin (x)) \, dx &=\int (b \csc (x)+a \cot (x) \csc (x)) \, dx\\ &=a \int \cot (x) \csc (x) \, dx+b \int \csc (x) \, dx\\ &=-b \tanh ^{-1}(\cos (x))-a \operatorname {Subst}(\int 1 \, dx,x,\csc (x))\\ &=-b \tanh ^{-1}(\cos (x))-a \csc (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 0.01, size = 25, normalized size = 2.08 \[ -a \csc (x)+b \log \left (\sin \left (\frac {x}{2}\right )\right )-b \log \left (\cos \left (\frac {x}{2}\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.46, size = 33, normalized size = 2.75 \[ -\frac {b \log \left (\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right ) \sin \relax (x) - b \log \left (-\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right ) \sin \relax (x) + 2 \, a}{2 \, \sin \relax (x)} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.20, size = 33, normalized size = 2.75 \[ b \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right ) - \frac {1}{2} \, a \tan \left (\frac {1}{2} \, x\right ) - \frac {2 \, b \tan \left (\frac {1}{2} \, x\right ) + a}{2 \, \tan \left (\frac {1}{2} \, x\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.50, size = 19, normalized size = 1.58 \[ -\frac {a}{\sin \relax (x )}+b \ln \left (-\cot \relax (x )+\csc \relax (x )\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 24, normalized size = 2.00 \[ -\frac {1}{2} \, b {\left (\log \left (\cos \relax (x) + 1\right ) - \log \left (\cos \relax (x) - 1\right )\right )} - \frac {a}{\sin \relax (x)} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.40, size = 24, normalized size = 2.00 \[ b\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )-\frac {a}{2\,\mathrm {tan}\left (\frac {x}{2}\right )}-\frac {a\,\mathrm {tan}\left (\frac {x}{2}\right )}{2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.83, size = 24, normalized size = 2.00 \[ - \frac {a}{\sin {\relax (x )}} + \frac {b \log {\left (\cos {\relax (x )} - 1 \right )}}{2} - \frac {b \log {\left (\cos {\relax (x )} + 1 \right )}}{2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________